﻿using Castle.ActiveRecord;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Online_Course.Domain
{
    [ActiveRecord]
    public class Student_Course:BaseEntity<Student_Course>
    {
        /// <summary>
        /// 关联课程
        /// </summary>
        [BelongsTo("CourseID", Cascade = CascadeEnum.None, Lazy = FetchWhen.OnInvoke)]
        [Display(Name = "关联课程")]
        public Course Course { get; set; }

        /// <summary>
        /// 关联学生
        /// </summary>
        [BelongsTo("StudentID", Cascade = CascadeEnum.None, Lazy = FetchWhen.OnInvoke)]
        [Display(Name = "关联学生")]
        public Student Student { get; set; }

        [Property(Length = 30, NotNull = false)]
        [Display(Name = "学生名")]
        public string StudentName { get; set; }

        [Property(Length = 30, NotNull = false)]
        [Display(Name = "课程名")]
        public string CourseName { get; set; }

        [Property(Length = 30, NotNull = false)]
        [Display(Name = "任课老师")]
        public string TeacherName { get; set; }

        [Property(Length = 30, NotNull = false)]
        [Display(Name = "审核状态")]
        public int AuditActive { get; set; }
    }
}
